import React from 'react';
import {createStore, combineReducers, applyMiddleware, compose} from 'redux';
import { BrowserRouter, HashRouter, Route, Link, Switch } from 'react-router-dom';

import {Provider} from 'react-redux';
import store from './Store.js';

import App from './App.js';
// 打印初始状态
// console.log(store.getState())
// 每次 state 更新时，打印日志
// 注意 subscribe() 返回一个函数用来注销监听器
// const unsubscribe = store.subscribe(() =>{
//   console.log(store.getState())
// })
const Router = () => (
    <BrowserRouter>
        <Provider store={store}>
            <App/>
        </Provider>
    </BrowserRouter>
)
export default Router;
